<script context="module">
	export function preload() {
		return this.fetch('blog.json').then(r => r.json()).then(posts => {
			return { posts };
		});
	}
</script>

<script>
	export let posts;
</script>

<h1>blog</h1>

{#each posts as post}
	<p><a href="blog/{post.slug}">{post.title}</a></p>
{/each}